var id = "";
var code = "";
var typeName = "";
var addForm = "";
$(function(){
	code = request.QueryString("code");//从跳转页面过来的
	typeName = decodeURIComponent(request.QueryString("typeName"));//从跳转页面过来的
	loadInfo();
	addForm = $("#addForm");
	addForm.form("disableValidation");
	$("#btncancel").click(function(){
		addForm.form('reset');
		addForm.form("disableValidation");
	});
	id = request.QueryString("id");//从跳转页面过来的
});

//回显信息
function loadInfo(){
	 $("#addForm").form('load',{
			sortCode:code,
			typeName:typeName
	 });
}
/**
 * 刷新grid
 */
function reloadGird() {
	gridReload("codeList");
}

function addBankAccount(){
	if(addForm.form('enableValidation')){
		addForm.form('submit',{
			url:'/addCode',
			success:function(msg){
				msg = $.parseJSON(msg);
				if(msg.returnCode == '00'){
					top.showMessage("添加成功!");
					closeIframeWindow();
					reloadGird();
				}else{
					top.showMessage("<font color='red'>" + msg.returnMsg  + "</font>!");
				}	
			}
		});
	}
}
